<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>   
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Form Plugin ajaxSubmit</title>
<style>
td{ color: #7d5;}
</style>
<script language="javascript" src="jquery.min.js"></script>
<script language="javascript">
$(document).ready(function(){
	/*JSON 遍历对象输出 */
	$("#showAll").click(function(){
		$.getJSON("WeiboAction_showFiveWeibo.do",function(json){
				$.each(json.weibos, function(i,item){
					$("<td/>").text(item.id).appendTo("p");
					$("<td/>").text(":").appendTo("p");
					$("<td/>").text(item.text).appendTo("p");
					$("<td/>").text(item.time).appendTo("p");
					$("p").append("<br/>");
					});
		});
	});
	$("#getItem").click(function (){
		alert($("#username").val());
		var url = 'WeiboAction_saveWeibo.do';
		var jsonWeibo = {
			weiboText : $("#username").attr("value")
		};
		var weiboStr = JSON.stringify(jsonWeibo);
		jQuery.post(url,{json:weiboStr},callb,'json');
	});
});
function callb(json){
	alert(json);
}
</script>
</head>
<body>
	<s:form action="user_reg.do" >
    	UserName：<s:textfield name="user.username" ></s:textfield><br/>
    	PassWord：<s:textfield name="user.password" ></s:textfield><br/>
    	<input type="submit" value="提交"/>  
    </s:form>
</body>
</html>